<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    xmlns:uc="http://www.quickzip.org/UserControls"
    xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/QuickZip.UserControls;component/Themes/Converters.xaml" />
        <ResourceDictionary Source="pack://application:,,,/QuickZip.UserControls;component/Themes/Brushes.xaml" />
    </ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="ListBorder"
                     Color="#828790"/>
    <Style x:Key="{x:Static GridView.GridViewStyleKey}"
           TargetType="{x:Type ListView}">
        <Setter Property="Background"
                Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
        <Setter Property="BorderBrush"
                Value="{StaticResource ListBorder}"/>
        <Setter Property="BorderThickness"
                Value="1"/>
        <Setter Property="Foreground"
                Value="#FF042271"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
                Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility"
                Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll"
                Value="true"/>
        <!--<Setter Property="ScrollViewer.PanningMode"
                Value="Both"/>-->
        <Setter Property="Stylus.IsFlicksEnabled"
                Value="False"/>
        <Setter Property="VerticalContentAlignment"
                Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListView}">
                    <theme:ListBoxChrome Name="Bd"
                                         BorderThickness="{TemplateBinding BorderThickness}"
                                         BorderBrush="{TemplateBinding BorderBrush}"
                                         Background="{TemplateBinding Background}"
                                         RenderMouseOver="{TemplateBinding IsMouseOver}"
                                         RenderFocused="{TemplateBinding IsKeyboardFocusWithin}"
                                         SnapsToDevicePixels="true">
                        <ScrollViewer Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}"
                                      Padding="{TemplateBinding Padding}">
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </ScrollViewer>
                    </theme:ListBoxChrome>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsGrouping"
                                 Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll"
                                    Value="false"/>
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter TargetName="Bd"
                                    Property="Background"
                                    Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="ListViewItemFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle StrokeThickness="1"
                               RadiusX="2"
                               RadiusY="2"
                               Stroke="#8E6EA6F5"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <LinearGradientBrush x:Key="ListItemHoverFill"
                         StartPoint="0,0"
                         EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="#FFF1FBFF"
                          Offset="0"/>
            <GradientStop Color="#FFD5F1FE"
                          Offset="1"/>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ListItemSelectedFill"
                         StartPoint="0,0"
                         EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="#FFD9F4FF"
                          Offset="0"/>
            <GradientStop Color="#FF9BDDFB"
                          Offset="1"/>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ListItemSelectedHoverFill"
                         StartPoint="0,0"
                         EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="#FFEAF9FF"
                          Offset="0"/>
            <GradientStop Color="#FFC9EDFD"
                          Offset="1"/>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ListItemSelectedInactiveFill"
                         StartPoint="0,0"
                         EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="#FFEEEDED"
                          Offset="0"/>
            <GradientStop Color="#FFDDDDDD"
                          Offset="1"/>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <!--{x:Static GridView.GridViewItemContainerStyleKey}-->
    <Style x:Key="AeroGridViewItemContainerStyleKey"
           TargetType="{x:Type ListViewItem}">
        <Setter Property="FocusVisualStyle"
                Value="{StaticResource ListViewItemFocusVisual}"/>
        <Setter Property="Background"
                Value="Transparent"/>
        <Setter Property="BorderBrush"
                Value="Transparent"/>
        <Setter Property="BorderThickness"
                Value="1"/>
        <Setter Property="Margin"
                Value="0,0,0,1"/>
        <Setter Property="Padding"
                Value="5,2,5,2"/>
        <Setter Property="VerticalContentAlignment"
                Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListViewItem}">
                    <Border BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Background="{TemplateBinding Background}"
                            CornerRadius="2"
                            SnapsToDevicePixels="true">
                        <Border Name="InnerBorder"
                                CornerRadius="1"
                                BorderThickness="1">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition MaxHeight="11"/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Rectangle Name="UpperHighlight"
                                           Visibility="Collapsed"
                                           Fill="#75FFFFFF"/>
                                <GridViewRowPresenter Grid.RowSpan="2"
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Grid>
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver"
                                 Value="true">
                            <Setter Property="Background"
                                    Value="{StaticResource ListItemHoverFill}"/>
                            <Setter Property="BorderBrush"
                                    Value="#FFCCF0FF"/>
                            <Setter TargetName="UpperHighlight"
                                    Property="Visibility"
                                    Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsSelected"
                                 Value="true">
                            <Setter Property="Background"
                                    Value="{StaticResource ListItemSelectedFill}"/>
                            <Setter Property="BorderBrush"
                                    Value="#FF98DDFB"/>
                            <Setter TargetName="InnerBorder"
                                    Property="BorderBrush"
                                    Value="#80FFFFFF"/>
                            <Setter TargetName="UpperHighlight"
                                    Property="Visibility"
                                    Value="Visible"/>
                            <Setter TargetName="UpperHighlight"
                                    Property="Fill"
                                    Value="#40FFFFFF"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected"
                                           Value="true"/>
                                <Condition Property="Selector.IsSelectionActive"
                                           Value="false"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background"
                                    Value="{StaticResource ListItemSelectedInactiveFill}"/>
                            <Setter Property="BorderBrush"
                                    Value="#FFCFCFCF"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected"
                                           Value="true"/>
                                <Condition Property="IsMouseOver"
                                           Value="true"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background"
                                    Value="{StaticResource ListItemSelectedHoverFill}"/>
                            <Setter Property="BorderBrush"
                                    Value="#FF98DDFB"/>
                        </MultiTrigger>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="Foreground"
                                    Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
